import React, {
    PureComponent
} from 'react'
import ReactDOM from 'react-dom'
import './style.css'
export default class Modal extends PureComponent {
    render() {
        let wrap = document.getElementById('mc_modal')
        if (!wrap) {
            wrap = document.createElement('div')
        }
        wrap.id = 'mc_modal'
        document.getElementsByTagName("body")[0].appendChild(wrap)
        return (
            ReactDOM.createPortal(< div id="modal_contend" > {
                this.props.children
            } </div>, wrap)
        )
    }
}
